package com.wl.lib.widget

import android.view.View
import android.view.ViewGroup


// Created by wangliang on 2024/4/26.
class RecyclerAdapter(
    val data: MutableList<in Any> = mutableListOf()
) : RecyclerAdapterWrapper<BaseViewHolder<*>>(
    TypedRecyclerAdapter(data)
) {

    inline fun <reified V : View, reified T> registerViewType(
        crossinline itemLayoutParams: (() -> ViewGroup.LayoutParams),
        crossinline bindAction: (view: V, item: T, pos: Int) -> Unit
    ) {
        (innerAdapter as TypedRecyclerAdapter).registerViewType(itemLayoutParams, bindAction)
    }

    inline fun <reified V : View, reified T> registerViewType(
        crossinline bindAction: (view: V, item: T, pos: Int) -> Unit
    ) {
        (innerAdapter as TypedRecyclerAdapter).registerViewType(bindAction)
    }

}